package com.obrock;

import android.app.DialogFragment;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

/**
 * Created with IntelliJ IDEA.
 * User: Дмитрий Г. Кузнецов
 * Date: 02.11.12
 * Time: 11:06
 * To change this template use File | Settings | File Templates.
 */

public class ViewAbout extends DialogFragment {

    TextView version;
    TextView copyright;
    Button save;

    public ViewAbout() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.about, container);

        version = (TextView) view.findViewById(R.id.version);
        version.setText(getResources().getString(R.string.version, Main.getVersionName(Main.context)));

        copyright = (TextView) view.findViewById(R.id.copyright);
        copyright.setMovementMethod(LinkMovementMethod.getInstance());

        save = (Button) view.findViewById(R.id.save);
        save.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                    ViewAbout.this.dismiss();
            }
        });

        getDialog().setTitle(getResources().getString(R.string.menu_about));

        return view;
    }
}
